<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>改变盒子的大小</title>
    <style>
        .box{
            width: 50px;
            height: 50px;
            background: #eee;
            margin: 0 auto;
        }
        a
        {
            position: relative;
            right: 250px;
            float: right;
            font-size: large;
            text-decoration: none;
        }
        body{
            background-color: #F3EFE0;
        }
        .bot{
            color: #918E84;
            font-family:Arial, Helvetica, sans-serif;
            font-size: 24px;
            position: relative;
            top: 300px;
            right: 250px;
            float: right;
        }
    </style>
</head>
<body>
    <div id="box" class="box"></div>
    <br><br><br>
    <a href="../章节目录/第七章.html">返回上一页</a>
    <script>
        var box = document.getElementById('box');
        var i = 0;
        box.onclick = function(){
            ++i;
            if(i%2){        //单击次数为奇数, 变大
                this.style.width = '200px';
                this.style.height = '200px';
                this.innerHTML = '大';
            }else{          //单击次数为偶数变小
                this.style.width = '50px';
                this.style.height = '50px';
                this.innerHTML = '小';
            }
        }
    </script>
    <div class="bot"><br>
        <h3>Please appreciate((●'◡'●))......</h3>
    </div>
</body>
</html>